
ac.skill('Boss4-1'){
    cool = 8,
    title = '绯红突刺',
    targettype = '物体',
    range = 1200,
    casttime = 0,
    model1 = [[BOSS4_fhtc.mdl]],
    on_cast_shot = function(self)
        local hero = self.owner
        local target = self.target
        local point1 = hero:get_point()
        local point2 = target:get_point()
        local angle = point1 / point2
        local damage = hero:get('攻击') * 5
        local num = 7
        local time = 1
        ac.timer(50,num,function(t)
            local count = num - t.count
            local pt = point2 - {angle - 30,(count-num/2 - 0.5)*150}
            ac.hint_red(pt,150,time)
            ac.wait(time*1000,function()
                pt:effect{
                    model = self.model1,
                    size = 0.5,
                    time = 1,
                }
                hero:aoe_damage(pt,150,damage)
            end)
            local pt = point2 - {angle + 30,(count-num/2 - 0.5)*150}
            ac.hint_red(pt,150,time)
            ac.wait(time*1000,function()
                pt:effect{
                    model = self.model1,
                    size = 0.5,
                    time = 1,
                }
                hero:aoe_damage(pt,150,damage)
            end)
        end)
    end,
}


ac.skill('Boss4-2'){
    title = '乱舞剑袭',
    targettype = '物体',
    range = 1200,
    cool = 8,
    casttime = 0,
    model1 = [[BOSS4_lwjx.mdl]],
    model2 = [[BOSS2_ldjtcf.mdl]],
    on_shot = function(self,target,count)
        local hero = self.owner
        local point1 = hero:get_point()
        local point2 = target:get_point()
        local angle = point1 / point2
        local lock = {}
        local mover = ac.mover('line'){
            mover = hero,
            angle = angle,
            distance = 1200,
            speed = 2400,
            on_move = function(_,point)
                if point then
                    local effect = hero:create_shadow(point,angle,0.2)
                    local damage = hero:get('攻击') * 5
                    effect:play_animation('stand')
                    point:effect{
                        model = self.model2,
                        angle = angle,
                        time = 0.2,
                    }
                    hero:aoe_damage(point,200,damage,self,lock)
                end
            end,
            on_remove = function()
                count = count - 1
                if hero.effect then
                    hero.effect:remove()
                end
                if count>0 then
                    self:on_shot(target,count)
                end
            end
        }
        local time = 0.8
        hero:add_buff '技能蓄力'{time = 0.5,skill = self}
        mover:set_pause(true)
        hero:set_facing(angle)
        ac.hint_line(point1,angle,time)
        ac.wait(time*1000,function()
            hero.effect = hero:add_effect(self.model1)
            mover:set_pause(false)
        end)
    end,
    on_cast_shot = function(self)
        local hero = self.owner
        local target = self.target
        self:on_shot(target,2)
    end,
}
